<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
    <script src="../jquery.min.js"></script>
    <script src="./mi18n.js" type="module"></script>
    <script type="text/javascript">
      $(function() {
        Mi18n.config.page = window.location.pathname;
        Mi18n.config.website = 1;
        Mi18n.config.autoTranslate = true;
        Mi18n.config.defaultLanguage = 'zh';
        //Mi18n.config.insertLanguageUrl = 'https://www.520internet.com/admin/route.php?columns=api&module=language&file=language&action=insert';
        //Mi18n.config.getLanguageUrl = 'https://www.520internet.com/admin/route.php?columns=api&module=language&file=language&action=get';
        Mi18n.config.insertLanguageUrl = './admin/api.php?action=insertMi18n';
        Mi18n.config.getLanguageUrl = './admin/api.php?action=getMi18n';
        Mi18n.config.autoCollect = true;
        Mi18n.config.collectDelay = 3000;
        Mi18n.config.listenerAllMi18nsEvent = false;

        Mi18n.init();
        var language = Mi18n.cookie.get('systemLanguage') ? Mi18n.cookie.get('systemLanguage') : Mi18n
          .getLanguage();
        $('.translate a.' + language).addClass('current');
        $('#currentLanguage').text(Mi18n.websiteLanguage);
        $('.translate a').click(function() {
          if ($(this).attr('data-set-mi18n-language')) {
            $('.translate a').removeClass('current');
            $(this).addClass('current');
            Mi18n.cookie.set('systemLanguage', $(this).attr('data-set-mi18n-language'), '/');
            Mi18n.changeLanguage();
          }
          $('#currentLanguage').text(Mi18n.websiteLanguage);
        });

        $(parent.document).find('.translate a').click(function(event) {
          Mi18n.changeLanguage();
        });
      });
    </script>
  </head>
  <body>
    <div class="mi18n">中文，你好世界！</div>
  </body>
</html>
